import { Component, OnInit } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import * as $ from 'jquery';
@Component({
  selector: 'app-aux',
  templateUrl: './aux.component.html',
  styleUrls: ['./aux.component.css']
})
export class AuxComponent implements OnInit {

  constructor(private http: HttpClient) { }
  province: any;
  str: any;
  city: any;
  area: any;
  // 变量

  ngOnInit() {
    this.http.post('/link/province', {}).subscribe((data) => {
      this.province = data;
      // console.log(this.province);
    });
  }


 doChange(e) {
   this.http.post('/link/city', {province: e.target.value}).subscribe((data) => {
     this.city = data;
   });
 }

  doArea(e) {
    this.http.post('/link/area', {area: e.target.value}).subscribe((data) => {
      this.area = data;
    });
  }
}
